package com.tongfusoft.document.manager.user.service;

import java.util.Collection;
import java.util.List;

import org.springframework.security.core.GrantedAuthority;

import com.tongfusoft.da.pagehelper.PageInfo;
import com.tongfusoft.document.entity.AccountHasUsers;
import com.tongfusoft.document.entity.RoleHasUsers;
import com.tongfusoft.document.entity.Users;
import com.tongfusoft.spring.web.core.data.User;

public interface IDocumentUserService {
	/**
	 * 新建用户
	 * @param user
	 * @return
	 */
	public Users addUser(Users user,Users u);
	
	/**
	 * 删除用户
	 * @param user
	 * @return
	 */
	public void delUser(Users user,Users u);
	
	/**
	 * 更新用户信息,不包括密码
	 * @param user
	 * @return
	 */
	public void updateUserWithoutPwd(Users user,Users u);
	/**
	 * 重置密码
	 * @param user
	 */
	void rePassword(Users user, Users modiUser);
	/**
	 * 更新用户信息
	 * @param user
	 */
	public void updateUser(Users user,Users modiUser);
	
	
	/**
	 * 查询用户
	 * @param user
	 * @return
	 */
	public List<Users> getUserList();
	
	/**
	 * 根据条件获取对象
	 * @param user
	 * @return
	 */
	public Users getUserById(String userId);
	
	/**
	 * 用户表值表格
	 * @param user
	 * @return
	 */
	public PageInfo<Users> usersPageTable(int pageIndex,int pageSize,Users users); 
	
	
	/**
	 * 
	 * @param logName
	 * @return
	 */
	public Users getUserByLoginName(String loginName);

	
	/**
	 * 获取用户对应的菜单
	 * @param loginName
	 * @return
	 */
	public Collection<GrantedAuthority> loadUserAuthoritiesByName(String loginName);
	
	
	/**
	 * 获取用户密码
	 * @param loginName
	 * @return
	 */
	public String getPwdByName(String loginName);
	
	/**
	 **创建用户与角色关系
	 */
	public void saveRoleHasUser(String[] roleList,String userId,Users user);
	/**
	 **创建用户与角色关系
	 */
	public RoleHasUsers createRoleHasUser(RoleHasUsers roleHasUsers,Users user);
	
	/**
	 **删除用户与角色关系
	 */
	public void delRoleHasUser(RoleHasUsers roleHasUsers,Users user);
	
	/**
	 **查询用户与角色关系
	 */
	public List<RoleHasUsers> getRoleHasUser(RoleHasUsers roleHasUsers);
	
	/**
	 **创建用户与账户关系
	 */
	public AccountHasUsers createAccountHasUser(AccountHasUsers accountHasUsers,Users user);
	
	/**
	 **删除用户与账户关系
	 */
	public void delAccountHasUser(AccountHasUsers accountHasUsers,Users user);
	
	/**
	 **查询用户与账户关系
	 */
	public List<AccountHasUsers> getAccountHasUser(AccountHasUsers accountHasUsers);
	/**
	 **根据用户ID删除用户与角色关系
	 */
	public void delRoleHasUserByUserId(Users users);
	/**
	 **根据用户ID删除用户与账户关系
	 */
	public void delAccountHasUserByUserId(Users users);


}
